﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AUV5.Web.Pages
{
    public partial class UCUserStatistics : UserControlBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }

        #region##绑定数据
        /// <summary>
        /// 绑定数据
        /// 创建人：Wilson
        /// 创建时间：2011-11-25
        /// </summary>
        public void BindData()
        {
            string userId = base.PageBase.VerifiedUserID;

            decimal income = AUV5.BLL.OrderInfoBLL.Instance.GetIncomeByUserId(userId);    //总收入

            decimal cost = AUV5.BLL.OrderInfoBLL.Instance.GetTotalCostByUserId(userId);  //总支出

            decimal localCost = AUV5.BLL.OrderInfoBLL.Instance.GetLocalCostByUserId(userId);  //本地余额支付

            decimal onlineCost = AUV5.BLL.OrderInfoBLL.Instance.GetOnlineCostByUserId(userId);  //在线支付

            decimal balance = AUV5.BLL.OrderInfoBLL.Instance.GetBalanceByUserId(userId);   //余额

            decimal notPayment = AUV5.BLL.OrderInfoBLL.Instance.GetNotPaymentByUserId(userId);  //未付款

            lblIncome.Text = String.Format("{0:f2}", income);

            lblBalance.Text = String.Format("{0:f2}", balance);

            lblNotPay.Text = String.Format("{0:f2}", notPayment);

            lblCost.Text = String.Format("{0:f2}", cost);

            lblSellerCompletedCount.Text = Convert.ToString(AUV5.BLL.OrderInfoBLL.Instance.GetSellerCompleteBySeller(userId));   //卖成功服务数

            lblBuyerCompletedCount.Text = Convert.ToString(AUV5.BLL.OrderInfoBLL.Instance.GetBuyerCompleteByBuyer(userId)); ;    //买成功服务数
        }
        #endregion

    }


}